package org.thread.test00.demo09;

/**
 * 定义线程对象 - 实现用户使用打印机打印内容
 *
 * @author ZQX
 * @date 2025-03-13
 */
public class MyThread extends Thread {
    /**
     * 打印机
     */
    private Printer printer;

    /**
     * 用户
     */
    private String user;

    /**
     * 指定打印内容
     */
    private String msg;

    public MyThread() {
    }

    public MyThread(Printer printer, String user, String msg) {
        this.printer = printer;
        this.user = user;
        this.msg = msg;
    }

    @Override
    public void run() {
        printer.print04(user, msg);
    }
}
